# Contributor: Chleba <chlebik@gmail.com>
# Maintainer: Chleba <chlebik@gmail.com>
pkgname=netscanner
pkgver=0.5.1
pkgrel=1
pkgdesc="Network scanning & diagnostic tool"
url="https://github.com/Chleba/netscanner"
# s390x, ppc64le, riscv64: not supported
arch="all !s390x !ppc64le !riscv64"
license="MIT"
makedepends="cargo cargo-auditable"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Chleba/netscanner/archive/v$pkgver.tar.gz
cargo-update.patch
"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="
8a068c24bb26dcd17fc3ab4e5bf4857af7543d7eaf2fdf291c28cd9f05db5366a1d913aed1d9b3dacbe4e8737863c8ec9b70e77b2aa2518be69867424838661c  netscanner-0.5.1.tar.gz
09062da2bbaa59880e9dfbc5a0f80d0c9cd5eac3850ef112b48e1d0791b0b4619c4ecf1084634550cce6fc83ae9bdb48b334847e4a99c704be9715acfb7212c6  cargo-update.patch
"
